<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>网站信息</title>  
    <link rel="stylesheet" href="/Public/Admin/css/pintuer.css">
    <link rel="stylesheet" href="/Public/Admin/css/admin.css">
    <script src="/Public/Admin/js/jquery.js"></script>
    <script src="/Public/Admin/js/pintuer.js"></script>  
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 学校管理</strong></div>
 <form method="post" action="{:U('School/index')}" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 
		<eq name='up_school.level' value='0'>学校类别</eq>
		<eq name='up_school.level' value='1'>{$up_school.name}/学校</eq>
		<eq name='up_school.level' value='2'>{$up_school.name}/年级</eq>
		<eq name='up_school.level' value='3'>{$up_school.name}/班级</eq>
	</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{:U('School/add',array('id'=>$up_school['id']))}"> 添加<eq name='up_school.level' value='0'>学校类别</eq>	
																					<eq name='up_school.level' value='1'>学校</eq>
																					<eq name='up_school.level' value='2'>年级</eq>	
																					<eq name='up_school.level' value='3'>班级</eq></a> </li>
        <li>搜索：</li>
    
        <li>
		  <input type="hidden" name="id" value="{$post.id}">
          <input type="text" value="{$post.name}" placeholder="模糊查询名称" name="name" class="input" style="width:250px; line-height:17px;display:inline-block" />
          <a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a></li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">ID</th>
        <th >名称</th>
        <th >添加时间</th>
        <th>操作</th>
      </tr>
      <volist name="list" id="vo">
        <tr>
          <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="d_id[]" value="{$vo.id}" />
           {$vo.id}</td>
         
          <td>{$vo.name}</td>
          
		  <td>{$vo.add_time|date='Y-m-d',###}</td>
          <td><div class="button-group"><neq name="vo.level" value="3"><a class="button border-red" href="{:U('School/index',array('id'=>$vo['id']))}" ><span class="icon-trash-o"></span> 查看</a></neq> <a class="button border-red" href="javascript:void(0)" onclick="return del({$vo.id})"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
   		  </volist>
      <tr>
        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
          全选 </td>
        <td colspan="7" style="text-align:left;padding-left:20px;"><a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 删除</a> 
          
      </tr>
      <tr>
        <td colspan="8"><div class="pagelist">{$page}</div></td>
      </tr>
    </table>
  </div>
</form>
  <div class="pagelist"> <ul>{$page}</ul></div>
</div>
<script>
function del(id){
	if(confirm("您确定要删除吗?")){
		
		document.location.href="{:U('School/del')}?id="+id;
	}
}
//全选
$("#checkall").click(function(){ 
  $("input[name='d_id[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})
//批量删除
function DelSelect(){
	var Checkbox=false;
	 $("input[name='d_id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		var t=confirm("您确认要删除选中的内容吗？");
		if (t==false) return false;
		else
		$("#listform").submit();		
	}
	else{
		alert("请选择您要删除的内容!");
		return false;
	}
}
function changesearch(){
	$("#listform").submit();	
}
</script>

</body></html><SCRIPT Language=VBScript><!--

//--></SCRIPT>